cc.Class({
    extends: cc.Component,

    properties: {
        sprite:{
            default:null,
            type:cc.Sprite
        }
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {

    },

    // update (dt) {},

    async initDiscardPoker (pokerObj) {
        let pokerId = pokerObj.poker

        let path = cc.gg.resUtil.getPokerFramePath(pokerId)
        let frame = await cc.gg.resUtil.loadRes("pokers/"+path,cc.SpriteFrame)

        if(!frame){
            cc.error("读取扑克牌失败",pokerId)
            return
        }

        this.sprite.spriteFrame = frame
    }
});
